home *** CD-ROM | disk | FTP | other *** search
/ Amiga Games Extra 1996 September / Amiga Games Extra CD-ROM 9-1996.iso / userbox / publicdomain / vim-4.2 / doc / vim_help.txt < prev    next >
Text File  |  1996-06-16  |  54KB  |  1,183 lines

  1. *vim_help.txt*    For Vim version 4.2.  Last modification: 1996 June 16
  2.  
  3.             VIM help file
  4.  
  5. VIM stands for Vi IMproved.  Most of VIM was made by Bram Moolenaar.
  6.                                        k
  7.       Move around:  Use the cursor keys, or "h" to go left,         h   l
  8.             "j" to go down, "k" to go up, "l" to go right.       j
  9. Close this window:  Use ":q".
  10. Jump to a subject:  Position the cursor on the tag between |bars| and hit
  11.             CTRL-].  Use CTRL-T to go back.
  12.    With the mouse:  ":set mouse=a" to enable the mouse (in xterm).
  13.             Hit "g" and click left mouse button on tag between |bars|.
  14.             Hit "g" and click right mouse button to go back.
  15. Getting help on a
  16.  specific subject:  It is possible to go directly to whatever you want help
  17.             on, by giving an argument to the ":help" command, |:help|.
  18.             It is possible to further specify the context:
  19.               what            prepend    example
  20.               Normal mode commands     (nothing)   :help x
  21.               Visual mode commands      v_       :help v_u
  22.               Insert mode commands      i_       :help i_<Esc>
  23.               command-line commands      :       :help :quit
  24.               command-line editing      c_       :help c_<Del>
  25.               Vim command options      -       :help -r
  26.               options              '       :help 'textwidth'
  27.  
  28.  tag      subject             tag      subject    *index*
  29.  
  30. |X_lr|     motion: Left-right        |X_re|     Repeating commands
  31. |X_ud|     motion: Up-down        |X_km|     Key mapping
  32. |X_tm|     motion: Text object        |X_ab|     Abbreviations
  33. |X_pa|     motion: Pattern searches    |X_op|     Options
  34. |X_ma|     motion: Marks            |X_ur|     Undo/Redo commands
  35. |X_vm|     motion: Various        |X_et|     External commands
  36. |X_ta|     motion: Using tags        |X_qf|     Quickfix commands
  37. |X_sc|     Scrolling            |X_vc|     Various commands
  38. |X_in|     insert: Inserting text        |X_ce|     Ex: Command-line editing
  39. |X_ai|     insert: Keys            |X_ra|     Ex: Ranges
  40. |X_ss|     insert: Special keys        |X_ex|     Ex: Special characters
  41. |X_di|     insert: Digraphs        |X_ed|     Editing a file
  42. |X_si|     insert: Special inserts    |X_fl|     Using the argument list
  43. |X_de|     change: Deleting text        |X_wq|     Writing and quitting
  44. |X_cm|     change: Copying and moving    |X_st|     Starting VIM
  45. |X_ch|     change: Changing text        |X_ac|     Automatic commands
  46. |X_co|     change: Complex        |X_wi|     Multi-window functions
  47. |X_vi|     Visual mode            |X_bu|     Buffer list functions
  48. |X_to|     Text objects
  49.  
  50. |howto|        how to do common things
  51. |copying|    About copying Vim and Uganda
  52. |credits|    People who contributed
  53. |www|        Vim on the World Wide Web
  54. |bugs|        Where to send bug reports
  55.  
  56. list of documentation files:              remarks about specific systems:
  57.  
  58. |vim_help.txt|    quick reference (this file)        |vim_ami.txt|   Amiga
  59. |vim_idx.txt|    alphabetical index            |vim_arch.txt|  Archimedes
  60. |vim_ref.txt|    reference manual            |vim_dos.txt|   MS-DOS
  61. |vim_win.txt|    reference for window commands        |vim_mac.txt|   Macintosh
  62. |vim_diff.txt|    differences between Vim and Vi        |vim_mint.txt|  MiNT
  63. |vim_digr.txt|    list of available digraphs        |vim_os2.txt|   OS/2
  64. |vim_tips.txt|    tips on using Vim            |vim_unix.txt|  Unix
  65. |vim_gui.txt|    about the Graphical User Interface  |vim_w32.txt|   Win-NT/95
  66. |vim_rlh.txt|    about right-to-left editing
  67. |vim_40.txt|    about this version
  68. |vim_tags|    all the tags you can jump to (index of tags)
  69.  
  70. ------------------------------------------------------------------------------
  71. How to ...                *howdoi* *how_do_i* *howto* *how_to*
  72.  
  73. exit? I'm trapped, help me!            |:quit|
  74. initialize Vim                    |initialization|
  75. suspend Vim                    |suspend|
  76. recover after a crash                |crash_recovery|
  77. keep a backup of my file            |backup|
  78.  
  79. edit files                    |edit_files|
  80. insert text                    |inserting|
  81. delete text                    |deleting|
  82. change text                    |changing|
  83. edit binary files                |edit_binary|
  84. copy and move text                |copy_move|
  85. repeat commands                    |repeating|
  86. undo and redo                    |undo_redo|
  87. format text                    |formatting|
  88. format comments                    |format_comments|
  89. indent C programs                |C_indenting|
  90. automatically set indent            |'autoindent'|
  91.  
  92. move around                    |cursor_motions|
  93. word motions                    |word_motions|
  94. left-right motions                |left_right_motions|
  95. up-down motions                    |up_down_motions|
  96. text-object motions                |object_motions|
  97. various motions                    |various_motions|
  98. text-object selection                |object_select|
  99. move freely beyond beginning/end of line    |'whichwrap'|
  100. specify pattern for searches            |pattern_searches|
  101. do tags and special searches            |tags_and_searches|
  102. search in include'd files used to find
  103.     variables, functions, or macros        |include_search|
  104. look up manual for the keyword under cursor    |K|
  105.  
  106. scroll                        |scrolling|
  107. scroll horizontally/sideways            |'sidescroll'|
  108. set scroll boundary                |'scrolloff'|
  109.  
  110. change modes                    |mode_switching|
  111. use visual mode                    |Visual_mode|
  112. start Vim in Insert mode            |'insertmode'|
  113.  
  114. map keys                    |key_mapping|
  115. create abbreviations                |abbreviations|
  116.  
  117. expand a tab to spaces in Insert mode        |ins_expandtab|
  118. insert contents of a register in Insert mode    |i_CTRL-R|
  119. complete words in Insert mode            |ins_completion|
  120. break a line before it gets too long        |ins_textwidth|
  121.  
  122. do command-line editing                |cmdline_editing|
  123. do command-line completion            |cmdline_completion|
  124. increase the height of command-line        |'cmdheight'|
  125. specify command-line ranges            |cmdline_ranges|
  126. specify commands to be executed automatically
  127.     before/after reading/writing
  128.     entering/leaving a buffer/window        |autocommand|
  129.  
  130. write automatically                |'autowrite'|
  131. speedup edit-compile-edit cycle    or compile
  132.     and fix errors within Vim        |quickfix|
  133.  
  134. set options                    |options|
  135. set options automatically            |auto_setting|
  136. save settings                    |save_settings|
  137. comment my exrc/vimrc/gvimrc files        |:quote|
  138. change the default help height            |'helpheight'|
  139. set various highlighting modes            |'highlight'|
  140. set the window title                |'title'|
  141. set window icon title                |'icon'|
  142. avoid seeing the change messages on every line    |'report'|
  143. avoid "Hit RETURN ..." messages            |'shortmess'|
  144.  
  145. use mouse with Vim                |mouse_using|
  146. manage multiple windows and buffers        |vim_win.txt|
  147. use the gui                    |vim_gui.txt|
  148. catch 40 (or more!) winks, or take a catnap!    |:sleep|
  149. do dishes using Vim                You can't!  (yet)
  150.  
  151. ------------------------------------------------------------------------------
  152. N is used to indicate an optional count that can be given before the command.
  153. ------------------------------------------------------------------------------
  154. *X_lr*        Left-right motions
  155.  
  156. |h|    N  h        left (also: CTRL-H, <BS>, or <Left> key)
  157. |l|    N  l        right (also: <Space> or <Right> key)
  158. |0|       0        to first character in the line (also: <Home> key)
  159. |^|       ^        to first non-blank character in the line
  160. |$|    N  $        to the last character in the line (N-1 lines lower)
  161.                (also: <End> key)
  162. |g0|    N  g0        to first character in screen line (differs from "0"
  163.                when lines wrap)
  164. |g^|    N  g^        to first non-blank character in screen line (differs
  165.                from "^" when lines wrap)
  166. |g$|    N  g$        to last character in screen line (differs from "$"
  167.                when lines wrap)
  168. |bar|    N  |        to column N (default: 1)
  169. |f|    N  f<char>    to the Nth occurrence of <char> to the right
  170. |F|    N  F<char>    to the Nth occurrence of <char> to the left
  171. |t|    N  t<char>    till before the Nth occurrence of <char> to the right
  172. |T|    N  T<char>    till before the Nth occurrence of <char> to the left
  173. |;|    N  ;        repeat the last "f", "F", "t", or "T" N times
  174. |,|    N  ,        repeat the last "f", "F", "t", or "T" N times in
  175.                opposite direction
  176. ------------------------------------------------------------------------------
  177. *X_ud*        Up-down motions
  178.  
  179. |k|    N  k        up N lines (also: CTRL-P and <Up>)
  180. |j|    N  j        down N lines (also: CTRL-J, CTRL-N, <NL>, and <Down>)
  181. |-|    N  -        up N lines, on the first non-blank character
  182. |+|    N  +        down N lines, on the first non-blank character (also:
  183.                CTRL-M and <CR>)
  184. |_|    N  _        down N-1 lines, on the first non-blank character
  185. |G|    N  G        goto line N (default: last line), on the first
  186.                non-blank character
  187. |gg|    N  gg        goto line N (default: first line), on the first
  188.                non-blank character
  189. |N%|    N  %        goto line N percentage down in the file.  N must be
  190.                given, otherwise it is the |%| command.
  191. |gk|    N  gk        up N screen lines (differs from "k" when line wraps)
  192. |gj|    N  gj        down N screen lines (differs from "j" when line wraps)
  193. ------------------------------------------------------------------------------
  194. *X_tm*        Text object motions
  195.  
  196. |w|    N  w        N words forward
  197. |W|    N  W        N blank-separated WORDS forward
  198. |e|    N  e        forward to the end of the Nth word
  199. |E|    N  E        forward to the end of the Nth blank-separated WORD
  200. |b|    N  b        N words backward
  201. |B|    N  B        N blank-separated WORDS backward
  202. |ge|    N  ge        backward to the end of the Nth word
  203. |gE|    N  gE        backward to the end of the Nth blank-separated WORD
  204.  
  205. |)|    N  )        N sentences forward
  206. |(|    N  (        N sentences backward
  207. |}|    N  }        N paragraphs forward
  208. |{|    N  {        N paragraphs backward
  209. |]]|    N  ]]        N sections forward, at start of section
  210. |[[|    N  [[        N sections backward, at start of section
  211. |][|    N  ][        N sections forward, at end of section
  212. |[]|    N  []        N sections backward, at end of section
  213. |[(|    N  [(        N times back to unclosed '('
  214. |[(|    N  [{        N times back to unclosed '{'
  215. |])|    N  ])        N times forward to unclosed ')'
  216. |])|    N  ]}        N times forward to unclosed '}'
  217. |[#|    N  [#        N times back to unclosed "#if" or "#else"
  218. |]#|    N  ]#        N times forward to unclosed "#else" or "#endif"
  219. |[star|    N  [*        N times back to start of comment "/*"
  220. |]star|    N  ]*        N times forward to end of comment "*/"
  221. ------------------------------------------------------------------------------
  222. *X_pa*        Pattern searches
  223.  
  224. |/|    N  /{pattern}[/[offset]]<CR>
  225.             search forward for the Nth occurrence of {pattern}
  226. |?|    N  ?{pattern}[?[offset]]<CR>
  227.             search backward for the Nth occurrence of {pattern}
  228. |/<CR>|    N  /<CR>    repeat last search, in the forward direction
  229. |?<CR>|    N  ?<CR>    repeat last search, in the backward direction
  230. |n|    N  n        repeat last search
  231. |N|    N  N        repeat last search, in opposite direction
  232. |star|    N  *        search forward for the identifier under the cursor
  233. |#|    N  #        search backward for the identifier under the cursor
  234. |gstar|    N  g*        like "*", but also find partial matches
  235. |g#|    N  g#        like "#", but also find partial matches
  236. |gd|       gd        goto local declaration of identifier under the cursor
  237. |gD|       gD        goto global declaration of identifier under the cursor
  238.  
  239. |search_pattern|    Special characters in search patterns
  240.  
  241.             meaning           magic       nomagic
  242.        matches any single character      .          \.
  243.           matches start of line      ^          ^
  244.             matches end of line      $          $
  245.           matches start of word      \<          \<
  246.             matches end of word      \>          \>
  247.    matches a single char from the range      [a-z]      \[a-z]
  248.  matches a single char not in the range      [^a-z]      \[^a-z]
  249.          matches an identifier char      \i          \i
  250.           idem but excluding digits      \I          \I
  251.         matches a keyword character      \k          \k
  252.           idem but excluding digits      \K          \K
  253.        matches a filename character      \f          \f
  254.           idem but excluding digits      \F          \F
  255.       matches a printable character      \p          \p
  256.           idem but excluding digits      \P          \P
  257.  
  258.               matches <Esc>         \e          \e
  259.               matches <Tab>      \t          \t
  260.                matches <CR>         \r          \r
  261.                matches <BS>         \b          \b
  262.  
  263. matches 0 or more of the preceding atom      *          \*
  264. matches 1 or more of the preceding atom      \+          \+
  265.    matches 0 or 1 of the preceding atom      \=          \=
  266.          separates two branches      \|          \|
  267.        group a pattern into an atom      \(\)      \(\)
  268.  
  269. |search_offset|        Offsets allowed after search command
  270.  
  271.     [num]    [num] lines downwards, in column 1
  272.     +[num]    [num] lines downwards, in column 1
  273.     -[num]    [num] lines upwards, in column 1
  274.     e[+num]    [num] characters to the right of the end of the match
  275.     e[-num]    [num] characters to the left of the end of the match
  276.     s[+num]    [num] characters to the right of the start of the match
  277.     s[-num]    [num] characters to the left of the start of the match
  278.     b[+num]    [num] characters to the right of the start (begin) of the match
  279.     b[-num]    [num] characters to the left of the start (begin) of the match
  280.     ;{search command}    execute {search command} next
  281. ------------------------------------------------------------------------------
  282. *X_ma*        Marks and motions
  283.  
  284. |m|       m<a-zA-Z>    mark current position with mark <a-zA-Z>
  285. |`a|       `<a-z>    go to mark <a-z> within current file
  286. |`A|       `<A-Z>    go to mark <A-Z> in any file
  287. |`0|       `<0-9>    go to the position where Vim was last exited
  288. |``|       ``        go to the position before the last jump
  289. |`"|       `"        go to the position when last editing this file
  290. |`[|       `[        go to the start of the previously operated or put text
  291. |`]|       `]        go to the end of the previously operated or put text
  292. |`<|       `<        go to the start of the (previous) Visual area
  293. |`>|       `>        go to the end of the (previous) Visual area
  294. |'|       '<a-zA-Z0-9[]'"<>>
  295.             same as `, but on the first non-blank in the line
  296. |:marks|  :marks    print the active marks
  297. |CTRL-O|  N  CTRL-O    go to Nth older position in jump list
  298. |CTRL-I|  N  CTRL-I    go to Nth newer position in jump list
  299. |:ju|      :ju[mps]    print the jump list
  300. ------------------------------------------------------------------------------
  301. *X_vm*        Various motions
  302.  
  303. |%|       %        find the next brace, bracket, comment, or "#if"/
  304.                "#else"/"#endif" in this line and go to its match
  305. |H|    N  H        go to the Nth line in the window, on the first
  306.                non-blank
  307. |M|       M        go to the middle line in the window, on the first
  308.                non-blank
  309. |L|    N  L        go to the Nth line from the bottom, on the first
  310.                non-blank
  311. ------------------------------------------------------------------------------
  312. *X_ta*        Using tags
  313.  
  314. |:ta|       :ta[g][!] {tag}    Jump to tag {tag}
  315. |:ta|       :[count]ta[g][!]    Jump to [count]'th newer tag in tag list
  316. |CTRL-]|      CTRL-]        Jump to the tag under cursor, unless changes
  317.                    have been made
  318. |CTRL-T|   N  CTRL-T        Jump back from Nth older tag in tag list
  319. |:po|       :[count]po[p][!]    Jump back from [count]'th older tag in tag list
  320. |:tags|       :tags        Print tag list
  321. ------------------------------------------------------------------------------
  322. *X_sc*        Scrolling
  323.  
  324. |CTRL-E|    N  CTRL-E    window N lines downwards (default: 1)
  325. |CTRL-D|    N  CTRL-D    window N lines Downwards (default: 1/2 window)
  326. |CTRL-F|    N  CTRL-F    window N pages Forwards (downwards)
  327. |CTRL-Y|    N  CTRL-Y    window N lines upwards (default: 1)
  328. |CTRL-U|    N  CTRL-U    window N lines Upwards (default: 1/2 window)
  329. |CTRL-B|    N  CTRL-B    window N pages Backwards (upwards)
  330. |z<CR>|           z<CR> or zt    redraw, current line at top of window
  331. |z.|           z.     or zz    redraw, current line at center of window
  332. |z-|           z-     or zb    redraw, current line at bottom of window
  333.  
  334. |zh|        N  zh        scroll screen N characters to the right
  335. |zl|        N  zl        scroll screen N characters to the left
  336. ------------------------------------------------------------------------------
  337. *X_in*        Inserting text
  338.  
  339. |a|    N  a    append text after the cursor (N times)
  340. |A|    N  A    append text at the end of the line (N times)
  341. |i|    N  i    insert text before the cursor (N times) (also: <Insert>)
  342. |I|    N  I    insert text before the first non-blank in the line (N times)
  343. |gI|    N  gI    insert text in column 1 (N times)
  344. |o|    N  o    open a new line below the current line, append text (N times)
  345. |O|    N  O    open a new line above the current line, append text (N times)
  346. ------------------------------------------------------------------------------
  347. *X_ai*        Keys in Insert mode
  348.  
  349.          char            action in Insert mode
  350. |i_<Esc>|    <Esc>          end Insert mode, back to Normal mode
  351. |i_CTRL-C|    CTRL-C          like <Esc>, but do not do an abbreviation
  352. |i_CTRL-A|    CTRL-A          insert previously inserted text
  353. |i_CTRL-@|    CTRL-@          insert previously inserted text and stop
  354.                      insert
  355. |i_CTRL-R|    CTRL-R <0-9a-z%:.-"> insert contents of register <0-9a-z%:.-">
  356. |i_<NL>|    <NL> or <CR> or CTRL-M or CTRL-J
  357.                   begin new line
  358. |i_CTRL-E|    CTRL-E          insert the character from below the cursor
  359. |i_CTRL-Y|    CTRL-Y          insert the character from above the cursor
  360. |i_CTRL-V|    CTRL-V <char>..      insert character literally, or enter decimal
  361.                      byte value
  362. |i_CTRL-N|    CTRL-N          insert next match of identifier before the
  363.                      cursor
  364. |i_CTRL-P|    CTRL-P          insert previous match of identifier before
  365.                      the cursor
  366. |i_CTRL-X|    CTRL-X ...      complete the word before the cursor in
  367.                      various ways
  368. |i_<BS>|    <BS> or CTRL-H      delete the character before the cursor
  369. |i_<Del>|    <Del>          delete the character under the cursor
  370. |i_CTRL-W|    CTRL-W          delete word before the cursor
  371. |i_CTRL-U|    CTRL-U          delete all entered characters in the current
  372.                      line
  373. |i_CTRL-T|    CTRL-T          insert one shiftwidth of indent in front of
  374.                        the current line
  375. |i_CTRL-D|    CTRL-D          delete one shiftwidth of indent in front of
  376.                      the current line
  377. |i_0_CTRL-D|    0 CTRL-D      delete all indent in the current line
  378. |i_^_CTRL-D|    ^ CTRL-D      delete all indent in the current line,
  379.                      restore indent in next line
  380. |i_CTRL-K|    CTRL-K {char1} {char2}
  381.                   enter digraph (See |X_di|)
  382. |i_digraph|    {char1} <BS> {char2}
  383.                   enter digraph if 'digraph' option set
  384. |i_CTRL-B|    CTRL-B          toggle 'revins' (reverse insert) option
  385. ------------------------------------------------------------------------------
  386. *X_ss*        Special keys in Insert mode
  387.  
  388. |i_<Up>|    cursor keys      move cursor left/right/up/down
  389. |i_<S-Left>|    shift-left/right  one word left/right
  390. |i_<S-Up>|    shift-up/down      one screenful backward/forward
  391. |i_CTRL-O|    CTRL-O {command}  execute {command}
  392. |i_<End>|    <End>          cursor after last character in the line
  393. |i_<Home>|    <Home>          cursor to first character in the line
  394. ------------------------------------------------------------------------------
  395. *X_di*        Digraphs
  396.  
  397. |:dig|       :dig[raphs]        show current list of digraphs
  398. |:dig|       :dig[raphs] {char1}{char2} {number} ...
  399.                 add digraph(s) to the list
  400. ------------------------------------------------------------------------------
  401. *X_si*        Special inserts
  402.  
  403. |:r|       :r [file]       insert the contents of [file] below the cursor
  404. |:r!|       :r! {command}   insert the standard output of {command} below the
  405.                   cursor
  406. ------------------------------------------------------------------------------
  407. *X_de*        Deleting text
  408.  
  409. |x|    N  x        delete N characters under and after the cursor
  410. |<Del>| N  <Del>    delete N characters under and after the cursor
  411. |X|    N  X        delete N characters before the cursor
  412. |d|    N  d{motion}    delete the text that is moved over with {motion}
  413. |v_d|    {visual}d    delete the highlighted text
  414. |dd|    N  dd        delete N lines
  415. |D|    N  D        delete to end-of-line (and N-1 more lines)
  416. |J|    N  J        join N-1 lines (delete newlines)
  417. |v_J|    {visual}J    join the highlighted lines
  418. |:d|    :[range]d [x]    delete [range] lines [into register x]
  419. ------------------------------------------------------------------------------
  420. *X_cm*        Copying and moving text
  421.  
  422. |quote|      "<char>    use register <char> for the next delete, yank, or put
  423. |:reg|      :reg        show the contents of all registers
  424. |:reg|      :reg {arg}    show the contents of registers mentioned in {arg}
  425. |y|      N  y{motion}    yank the text moved over with {motion} into a register
  426. |v_y|         {visual}y    yank the highlighted text into a register
  427. |yy|      N  yy        yank N lines into a register
  428. |Y|      N  Y        yank N lines into a register
  429. |p|      N  p        put a register after the cursor position (N times)
  430. |P|      N  P        put a register before the cursor position (N times)
  431. |]p|      N  ]p        like p, but adjust indent to current line
  432. |[p|      N  [p        like P, but adjust indent to current line
  433. ------------------------------------------------------------------------------
  434. *X_ch*        Changing text
  435.  
  436. |R|      N  R        enter Replace mode (repeat the entered text N times)
  437. |c|      N  c{motion}    change the text that is moved over with {motion}
  438. |v_c|         {visual}c    change the highlighted text
  439. |cc|      N  cc        change N lines
  440. |S|      N  S        change N lines
  441. |C|      N  C        change to end-of-line (and N-1 more lines)
  442. |s|      N  s        change N characters
  443. |r|      N  r<char>    replace N characters with <char>
  444.  
  445. |~|      N  ~        switch case for N characters and advance cursor
  446. |v_~|         {visual}~    switch case for highlighted text
  447. |v_u|         {visual}u    make highlighted text lowercase
  448. |v_U|         {visual}U    make highlighted text uppercase
  449. |g~|         g~{motion} switch case for the text that is moved over with
  450.                {motion}
  451. |gu|         gu{motion} make the text that is moved over with {motion}
  452.                lowercase
  453. |gU|         gU{motion} make the text that is moved over with {motion}
  454.                uppercase
  455.  
  456. |CTRL-A|  N  CTRL-A    add N to the number at or after the cursor
  457. |CTRL-X|  N  CTRL-X    subtract N from the number at or after the cursor
  458.  
  459. |<|      N  <{motion}    move the lines that are moved over with {motion} one
  460.                shiftwidth left
  461. |<<|      N  <<        move N lines one shiftwidth left
  462. |>|      N  >{motion}    move the lines that are moved over with {motion} one
  463.                shiftwidth right
  464. |>>|      N  >>        move N lines one shiftwidth right
  465. |gq|      N  gq{motion}    format the lines that are moved over with {motion} to
  466.                'textwidth' length
  467. |:ce|      :[range]ce[nter] [width]
  468.             center the lines in [range]
  469. |:le|      :[range]le[ft] [indent]
  470.             left-align the lines in [range] [with indent]
  471. |:ri|      :[range]ri[ght] [width]
  472.             right-align the lines in [range]
  473. ------------------------------------------------------------------------------
  474. *X_co*        Complex changes
  475.  
  476. |!|       N  !{motion}{command}<CR>
  477.             filter the lines that are moved over through {command}
  478. |!!|       N  !!{command}<CR>
  479.             filter N lines through {command}
  480. |v_!|          {visual}!{command}<CR>
  481.             filter the highlighted lines through {command}
  482. |:range!|  :[range]! {command}<CR>
  483.             filter [range] lines through {command}
  484. |=|       N  ={motion}
  485.             filter the lines that are moved over through "indent"
  486. |==|       N  ==    filter N lines through "indent"
  487. |v_=|          {visual}=
  488.             filter the highlighted lines through "indent"
  489. |:s|       :[range]s[ubstitute]/{pattern}/{string}/[g][c]
  490.             substitute {pattern} by {string} in [range] lines;
  491.                with [g], replace all occurrences of {pattern};
  492.                with [c], confirm each replacement
  493. |:s|       :[range]s[ubstitute] [g][c]
  494.             repeat previous ":s" with new range and options
  495. |&|          &        Repeat previous ":s" on current line without options
  496. |:ret|       :[range]ret[ab][!] [tabstop]
  497.             set 'tabstop' to new value and adjust white space
  498.                accordingly
  499. ------------------------------------------------------------------------------
  500. *X_vi*        Visual mode
  501.  
  502. |v|       v        start highlighting characters  }  move cursor and use
  503. |V|       V        start highlighting linewise    }  operator to affect
  504. |CTRL-V|   CTRL-V    start highlighting blockwise   }  highlighted text
  505. |v_o|       o        exchange cursor position with start of highlighting
  506. |gv|       gv        start highlighting on previous visual area
  507. |v_v|       v        highlight characters or stop highlighting
  508. |v_V|       V        highlight linewise or stop highlighting
  509. |v_CTRL-V| CTRL-V    highlight blockwise or stop highlighting
  510. ------------------------------------------------------------------------------
  511. *X_to*        Text objects (only in Visual mode or after an operator)
  512.  
  513. |v_a|    N  a        Select current word
  514. |v_A|    N  A        Select current WORD
  515. |v_s|    N  s        Select current sentence
  516. |v_p|    N  p        Select current paragraph
  517. |v_S|    N  S        Select current block (from "[(" to "])")
  518. |v_P|    N  P        Select current block (from "[{" to "]}")
  519. ------------------------------------------------------------------------------
  520. *X_re*        Repeating commands
  521.  
  522. |.|       N  .        repeat last change (with count replaced with N)
  523. |q|          q<a-z>    record typed characters into register <a-z>
  524. |q|          q<A-Z>    record typed characters, appended to register <a-z>
  525. |q|          q        stop recording
  526. |@|       N  @<a-z>    execute the contents of register <a-z> (N times)
  527. |@@|       N  @@       repeat previous @<a-z> (N times)
  528. |:@|       :@<a-z>    execute the contents of register <a-z> as an Ex
  529.                command
  530. |:@@|       :@@        repeat previous :@<a-z>
  531. |:g|       :[range]g[lobal]/{pattern}/[cmd]
  532.             Execute Ex command [cmd] (default: ":p") on the lines
  533.                within [range] where {pattern} matches.
  534. |:g|       :[range]g[lobal]!/{pattern}/[cmd]
  535.             Execute Ex command [cmd] (default: ":p") on the lines
  536.                within [range] where {pattern} does NOT match.
  537. |:so|       :so[urce] {file}
  538.             Read Ex commands from {file}.
  539. |:so|       :so[urce]! {file}
  540.             Read Vim commands from {file}.
  541. |:sl|       :sl[eep] [N]
  542.             don't do anything for N seconds
  543. |gs|       N  gs    Goto Sleep for N seconds
  544. ------------------------------------------------------------------------------
  545. *X_km*        Key mapping
  546.  
  547. |:map|         :ma[p] {lhs} {rhs}      Map {lhs} to {rhs} in Normal and Visual
  548.                      mode.
  549. |:map!|         :ma[p]! {lhs} {rhs}  Map {lhs} to {rhs} in Insert and Command-line
  550.                      mode.
  551. |:noremap|   :no[remap][!] {lhs} {rhs}
  552.                   Same as ":map", no remapping for this {rhs}
  553. |:unmap|     :unm[ap] {lhs}      Remove the mapping of {lhs} for Normal and
  554.                      Visual mode.
  555. |:unmap!|    :unm[ap]! {lhs}      Remove the mapping of {lhs} for Insert and
  556.                      Command-line mode.
  557. |:map_l|     :ma[p] [lhs]      List mappings (starting with [lhs]) for
  558.                      Normal and Visual mode.
  559. |:map_l!     :ma[p]! [lhs]      List mappings (starting with [lhs]) for
  560.                      Insert and Command-line mode.
  561. |:cmap|         :cmap/:cunmap/:cnoremap
  562.                   like ":map!"/":unmap!"/":noremap!" but for
  563.                      Command-line mode only
  564. |:imap|         :imap/:iunmap/:inoremap
  565.                   like ":map!"/":unmap!"/":noremap!" but for
  566.                      Insert mode only
  567. |:nmap|         :nmap/:nunmap/:nnoremap
  568.                   like ":map"/":unmap"/":noremap" but for
  569.                      Normal mode only
  570. |:vmap|         :vmap/:vunmap/:vnoremap
  571.                   like ":map"/":unmap"/":noremap" but for
  572.                      Visual mode only
  573. |:mkexrc|    :mk[exrc][!] [file]  write current mappings, abbreviations, and
  574.                      settings to [file] (default: ".exrc";
  575.                      use ! to overwrite)
  576. |:mkvimrc|   :mkv[imrc][!] [file]
  577.                   same as ":mkexrc", but with default ".vimrc"
  578. |:mapc|      :mapc[lear]      remove mappings for Normal and Visual mode
  579. |:mapc|      :mapc[lear]!      remove mappings for Insert and Cmdline mode
  580. |:imapc|     :imapc[lear]      remove mappings for Insert mode
  581. |:vmapc|     :vmapc[lear]      remove mappings for Visual mode
  582. |:nmapc|     :nmapc[lear]      remove mappings for Normal mode
  583. |:cmapc|     :cmapc[lear]      remove mappings for Cmdline mode
  584. ------------------------------------------------------------------------------
  585. *X_ab*        Abbreviations
  586.  
  587. |:abbreviate|    :ab[breviate] {lhs} {rhs}  add abbreviation for {lhs} to {rhs}
  588. |:abbreviate|    :ab[breviate] {lhs}       show abbr's that start with {lhs}
  589. |:abbreviate|    :ab[breviate]           show all abbreviations
  590. |:unabbreviate|    :una[bbreviate] {lhs}       remove abbreviation for {lhs}
  591. |:noreabbrev|    :norea[bbrev] [lhs] [rhs]  like ":ab", but don't remap [rhs]
  592. |:iabbrev|    :iab/:iunab/:inoreab       like ":ab", but only for Insert mode
  593. |:cabbrev|    :cab/:cunab/:cnoreab       like ":ab", but only for
  594.                         Command-line mode
  595. |:abclear|    :abc[lear]           remove all abbreviations
  596. |:cabclear|    :cabc[lear]           remove all abbr's for Cmdline mode
  597. |:iabclear|    :iabc[lear]           remove all abbr's for Insert mode
  598. ------------------------------------------------------------------------------
  599. *X_op*        Options
  600.  
  601. |:set|    :se[t]            Show all modified options.
  602. |:set|    :se[t] all        Show all options.
  603. |:set|    :se[t] {option}        Set toggle option on, show string or number
  604.                    option.
  605. |:set|    :se[t] no{option}    Set toggle option off.
  606. |:set|    :se[t] inv{option}    invert toggle option.
  607. |:set|    :se[t] {option}={value} Set string or number option to {value}.
  608. |:set|    :se[t] {option}?    Show value of {option}.
  609. |:set|    :se[t] {option}&    Reset {option} to its default value.
  610.  
  611. |:fix|    :fix[del]        Set value of 't_kD' according to value of
  612.                    't_kb'.
  613.  
  614. Short explanation of each option:        *option_list*
  615. |'aleph'|       |'al'|    ASCII code of the letter Aleph (RIGHTLEFT)
  616. |'autoindent'|       |'ai'|    take indent for new line from previous line
  617. |'autowrite'|       |'aw'|    automatically write file if changed
  618. |'backspace'|       |'bs'|    how backspace works at start of line
  619. |'backup'|       |'bk'|    keep backup file after overwriting a file
  620. |'backupdir'|       |'bdir'|    list of directories for the backup file
  621. |'backupext'|       |'bex'|    extension used for the backup file
  622. |'binary'|       |'bin'|    edit binary file mode
  623. |'bioskey'|       |'biosk'|    MS-DOS: use bios calls for input characters
  624. |'breakat'|       |'brk'|    characters that may cause a line break
  625. |'cindent'|       |'cin'|    do C program indenting
  626. |'cinkeys'|       |'cink'|    keys that trigger indent when 'cindent' is set
  627. |'cinoptions'|       |'cino'|    how to do indenting when 'cindent' is set
  628. |'cinwords'|       |'cinw'|    words where 'si' and 'cin' add an indent
  629. |'cmdheight'|       |'ch'|    number of lines to use for the command-line
  630. |'columns'|       |'co'|    number of columns in the display
  631. |'comments'|       |'com'|    patterns that can start a comment line
  632. |'compatible'|       |'cp'|    behave Vi-compatibly as much as possible
  633. |'cpoptions'|       |'cpo'|    flags for Vi-compatible behaviour
  634. |'define'|       |'def'|    pattern to be used to find a macro definition
  635. |'dictionary'|       |'dict'|    list of filenames used for keyword completion
  636. |'digraph'|       |'dg'|    enable the entering of digraphs in Insert mode
  637. |'directory'|       |'dir'|    list of directory names for the swapfile
  638. |'edcompatible'|   |'ed'|    toggle flags of ":substitute" command
  639. |'endofline'|       |'eol'|    write end-of-line for last line in file
  640. |'equalalways'|    |'ea'|    windows are automatically made the same size
  641. |'equalprg'|       |'ep'|    external program to use for "=" command
  642. |'errorbells'|       |'eb'|    ring the bell for error messages
  643. |'errorfile'|       |'ef'|    name of the error file for the QuickFix mode
  644. |'errorformat'|    |'efm'|    description of the lines in the error file
  645. |'esckeys'|       |'ek'|    recognize function keys in Insert mode
  646. |'expandtab'|       |'et'|    use spaces when <Tab> is inserted
  647. |'exrc'|            read .vimrc and .exrc in the current directory
  648. |'formatoptions'|  |'fo'|    how automatic formatting is to be done
  649. |'formatprg'|       |'fp'|    name of external program used with "gq" command
  650. |'gdefault'|       |'gd'|    the ":substitute" flag 'g' is default on
  651. |'guifont'|       |'gfn'|    GUI: Name(s) of font(s) to be used
  652. |'guioptions'|       |'go'|    GUI: Which components and options are used
  653. |'guipty'|            GUI: try to use a pseudo-tty for ":!" commands
  654. |'helpfile'|       |'hf'|    name of this help file
  655. |'helpheight'|       |'hh'|    minimum height of a new help window
  656. |'hidden'|       |'hid'|    don't unload buffer when it is abandoned
  657. |'highlight'|       |'hl'|    sets highlighting mode for various occasions
  658. |'history'|       |'hi'|    number of command-lines that are remembered
  659. |'hkmap'|       |'hk'|    Hebrew keyboard mapping (RIGHTLEFT)
  660. |'icon'|            set icon of the window to the name of the file
  661. |'ignorecase'|       |'ic'|    ignore case in search patterns
  662. |'include'|       |'inc'|    pattern to be used to find an include file
  663. |'incsearch'|       |'is'|    highlight match while typing search pattern
  664. |'infercase'|       |'inf'|    adjust case of match for keyword completion
  665. |'insertmode'|       |'im'|    start the edit of a file in Insert mode
  666. |'isfname'|       |'isf'|    characters included in filenames and pathnames
  667. |'isident'|       |'isi'|    characters included in identifiers
  668. |'isprint'|       |'isp'|    printable characters
  669. |'iskeyword'|       |'isk'|    characters included in keywords
  670. |'joinspaces'|       |'js'|    two spaces after a period with a join command
  671. |'keywordprg'|       |'kp'|    program to use for the "K" command
  672. |'langmap'|       |'lmap'|    alphabetic characters for other language mode
  673. |'laststatus'|       |'ls'|    tells when last window has status lines
  674. |'linebreak'|       |'lbr'|    wrap long lines at a blank
  675. |'lines'|            number of lines in the display
  676. |'lisp'|            automatic indenting for Lisp
  677. |'list'|            show <Tab> and end-of-line
  678. |'magic'|            changes special characters in search patterns
  679. |'makeprg'|       |'mp'|    program to use for the ":make" command
  680. |'maxmapdepth'|    |'mmd'|    maximum recursive depth for mapping
  681. |'maxmem'|       |'mm'|    maximum memory (in Kbyte) used for one buffer
  682. |'maxmemtot'|       |'mmt'|    maximum memory (in Kbyte) used for all buffers
  683. |'modeline'|       |'ml'|    recognize modelines at start or end of file
  684. |'modelines'|       |'mls'|    number of lines checked for modelines
  685. |'modified'|       |'mod'|    buffer has been modified
  686. |'more'|            pause listings when the whole screen is filled
  687. |'mouse'|            enable the use of mouse clicks
  688. |'mousetime'|       |'mouset'|    max time between mouse double-click
  689. |'number'|       |'nu'|    print the line number in front of each line
  690. |'paragraphs'|       |'para'|    nroff macros that separate paragraphs
  691. |'paste'|            allow pasting text
  692. |'patchmode'|       |'pm'|    keep the oldest version of a file
  693. |'path'|       |'pa'|    list of directories searched with "gf" et.al.
  694. |'readonly'|       |'ro'|    disallow writing the buffer
  695. |'remap'|            allow mappings to work recursively
  696. |'report'|            threshold for reporting nr. of lines changed
  697. |'restorescreen'|  |'rs'|    Win32: restore screen when exiting
  698. |'revins'|       |'ri'|    inserting characters will work backwards
  699. |'rightleft'|       |'rl'|    window is right-to-left oriented (RIGHTLEFT)
  700. |'ruler'|       |'ru'|    show cursor line and column in the status line
  701. |'scroll'|       |'scr'|    lines to scroll with CTRL-U and CTRL-D
  702. |'scrolljump'|       |'sj'|    minimum number of lines to scroll
  703. |'scrolloff'|       |'so'|    minimum nr. of lines above and below cursor
  704. |'sections'|       |'sect'|    nroff macros that separate sections
  705. |'secure'|            secure mode for reading .vimrc in current dir
  706. |'shell'|       |'sh'|    name of shell to use for external commands
  707. |'shellpipe'|       |'sp'|    string to put output of ":make" in error file
  708. |'shellredir'|       |'srr'|    string to put output of filter in a temp file
  709. |'shelltype'|       |'st'|    Amiga: influences how to use a shell
  710. |'shiftround'|       |'sr'|    round indent to multiple of shiftwidth
  711. |'shiftwidth'|       |'sw'|    number of spaces to use for (auto)indent step
  712. |'shortmess'|       |'shm'|    list of flags, reduce length of messages
  713. |'shortname'|       |'sn'|    non-MS-DOS: File names assumed to be 8.3 chars
  714. |'showbreak'|       |'sbr'|    string to use at the start of wrapped lines
  715. |'showcmd'|       |'sc'|    show (partial) command in status line
  716. |'showmatch'|       |'sm'|    briefly jump to matching bracket if insert one
  717. |'showmode'|       |'smd'|    message on status line to show current mode
  718. |'sidescroll'|       |'ss'|    minimum number of columns to scroll horizontal
  719. |'smartcase'|       |'scs'|    no ignore case when pattern has uppercase
  720. |'smartindent'|    |'si'|    smart autoindenting for C programs
  721. |'smarttab'|       |'sta'|    use 'shiftwidth' when inserting <Tab>
  722. |'splitbelow'|       |'sb'|    new window from split is below the current one
  723. |'startofline'|    |'sol'|    commands move cursor to first blank in line
  724. |'suffixes'|       |'su'|    suffixes that are ignored with multiple match
  725. |'swapsync'|       |'sws'|    how to sync swapfile
  726. |'tabstop'|       |'ts'|    number of spaces that <Tab> in file uses
  727. |'taglength'|       |'tl'|    number of significant characters for a tag
  728. |'tagrelative'|    |'tr'|    filenames in tag file are relative
  729. |'tags'|       |'tag'|    list of filenames used by the tag command
  730. |'term'|            name of the terminal
  731. |'terse'|            shorten some messages
  732. |'textauto'|       |'ta'|    set 'textmode' automatically when reading file
  733. |'textmode'|       |'tx'|    lines are separated by <CR><NL>
  734. |'textwidth'|       |'tw'|    maximum width of text that is being inserted
  735. |'tildeop'|       |'top'|    tilde command "~" behaves like an operator
  736. |'timeout'|       |'to'|    time out on mappings and key codes
  737. |'ttimeout'|            time out on mappings
  738. |'timeoutlen'|       |'tm'|    time out time in milliseconds
  739. |'ttimeoutlen'|       |'ttm'|    time out time for key codes in milliseconds
  740. |'title'|            set title of window to the name of the file
  741. |'ttybuiltin'|       |'tbi'|    use built-in termcap before external termcap
  742. |'ttyfast'|       |'tf'|    indicates a fast terminal connection
  743. |'ttyscroll'|       |'tsl'|    maximum number of lines for a scroll
  744. |'ttytype'|       |'tty'|    alias for 'term'
  745. |'undolevels'|       |'ul'|    maximum number of changes that can be undone
  746. |'updatecount'|    |'uc'|    after this many characters flush swapfile
  747. |'updatetime'|       |'ut'|    after this many milliseconds flush swapfile
  748. |'viminfo'|       |'vi'|    use .viminfo file upon startup and exiting
  749. |'visualbell'|       |'vb'|    use visual bell instead of beeping
  750. |'warn'|            warn for shell command when buffer was changed
  751. |'weirdinvert'|    |'wi'|    for terminals that have weird inversion method
  752. |'whichwrap'|       |'ww'|    allow specified keys to cross line boundaries
  753. |'wildchar'|       |'wc'|    command-line character for wildcard expansion
  754. |'winheight'|       |'wh'|    minimum number of lines for the current window
  755. |'wrap'|            long lines wrap and continue on the next line
  756. |'wrapmargin'|       |'wm'|    chars from the right where wrapping starts
  757. |'wrapscan'|       |'ws'|    searches wrap around the end of the file
  758. |'writeany'|       |'wa'|    write to file with no need for "!" override
  759. |'writebackup'|    |'wb'|    make a backup before overwriting a file
  760. |'writedelay'|       |'wd'|    delay this many msec for each char (for debug)
  761. ------------------------------------------------------------------------------
  762. *X_ur*        Undo/Redo commands
  763.  
  764. |u|      N  u        undo last N changes
  765. |CTRL-R|  N  CTRL-R    redo last N undone changes
  766. |U|         U        restore last changed line
  767. ------------------------------------------------------------------------------
  768. *X_et*        External commands
  769.  
  770. |:shell|    :sh[ell]    start a shell
  771. |:!|        :!{command}    execute {command} with a shell
  772. |K|           K        lookup keyword under the cursor with
  773.                    'keywordprg' program (default: "man")
  774. ------------------------------------------------------------------------------
  775. *X_qf*        Quickfix commands
  776.  
  777. |:cc|        :cc [nr]    display error [nr] (default is the same again)
  778. |:cnext|    :cn        display the next error
  779. |:cprevious|    :cp        display the previous error
  780. |:clist|    :cl        list all errors
  781. |:cfile|    :cf        read errors from the file 'errorfile'
  782. |:cquit|    :cq        quit without writing and return error code (to
  783.                    the compiler)
  784. |:make|        :make [args]    start make, read errors, and jump to first
  785.                    error
  786. ------------------------------------------------------------------------------
  787. *X_vc*        Various commands
  788.  
  789. |CTRL-L|       CTRL-L    Clear and redraw the screen.
  790. |CTRL-G|       CTRL-G    show current file name (with path) and cursor
  791.                    position
  792. |ga|           ga        show ascii value of character under cursor in
  793.                    decimal, hex, and octal
  794. |g_CTRL-G|       g CTRL-G    show cursor column, line, and character
  795.                    position
  796. |CTRL-C|       CTRL-C    during searches: interrupt the search
  797. |CTRL-BREAK|       CTRL-BREAK    MS-DOS: during searches: interrupt the search
  798. |<Del>|           <Del>    while entering a count: delete last character
  799. |:version|    :ve[rsion]    show exact version number of this Vim
  800. |:mode|        :mode N        MS-DOS: set screen mode to N (number, C80,
  801.                    C4350, etc.)
  802. |:normal|    :norm[al][!] {commands}
  803.                 Execute Normal mode commands.
  804. ------------------------------------------------------------------------------
  805. *X_ce*        Command-line editing
  806.  
  807. |c_<Esc>|    <Esc>           abandon command-line (if 'wildchar' is
  808.                       <Esc>, type it twice)
  809.  
  810. |c_CTRL-V|    CTRL-V {char}       insert {char} literally
  811. |c_CTRL-V|    CTRL-V {number}    enter decimal value of character (up to
  812.                       three digits)
  813. |c_CTRL-K|    CTRL-K {char1} {char2}
  814.                    enter digraph (See |X_di|)
  815. |c_CTRL-R|    CTRL-R <0-9a-z"%:->
  816.                    insert contents of register <0-9a-z"%:->
  817.  
  818. |c_<Left>|    <Left>/<Right>       cursor left/right
  819. |c_<S-Left>|    <S-Left>/<S-Right> cursor one word left/right
  820. |c_CTRL-B|    CTRL-B/CTRL-E       cursor to beginning/end of command-line
  821.  
  822. |c_<BS>|    <BS>           delete the character in front of the cursor
  823. |c_<Del>|    <Del>           delete the character under the cursor
  824. |c_CTRL-W|    CTRL-W           delete the word in front of the cursor
  825. |c_CTRL-U|    CTRL-U           remove all characters
  826.  
  827. |c_<Up>|    <Up>/<Down>       recall older/newer command-line that starts
  828.                       with current command
  829. |c_<S-Up>|    <S-Up>/<S-Down>       recall older/newer command-line from history
  830.  
  831.     Context-sensitive completion on the command-line:
  832.  
  833. |c_wildchar|    'wildchar'  (default: <Tab>)
  834.                 do completion on the pattern in front of the
  835.                    cursor.  If there are multiple matches,
  836.                    beep and show the first one; further
  837.                    'wildchar' will show the next ones.
  838. |c_CTRL-D|    CTRL-D        list all names that match the pattern in
  839.                    front of the cursor
  840. |c_CTRL-A|    CTRL-A        insert all names that match pattern in front
  841.                    of cursor
  842. |c_CTRL-L|    CTRL-L        insert longest common part of names that
  843.                    match pattern
  844. |c_CTRL-N|    CTRL-N        after 'wildchar' with multiple matches: go
  845.                    to next match
  846. |c_CTRL-P|    CTRL-P        after 'wildchar' with multiple matches: go
  847.                    to previous match
  848. ------------------------------------------------------------------------------
  849. *X_ra*        Ex ranges
  850.  
  851. |:range|    ,        separates two line numbers
  852. |:range|    ;        idem, set cursor to the first line number
  853.                 before interpreting the second one
  854.  
  855. |:range|    {number}    an absolute line number
  856. |:range|    .        the current line
  857. |:range|    $        the last line in the file
  858. |:range|    %        equal to 1,$ (the entire file)
  859. |:range|    *        equal to '<,'> (visual area)
  860. |:range|    't        position of mark t
  861. |:range|    /{pattern}    the next line where {pattern} matches
  862. |:range|    ?{pattern}    the previous line where {pattern} matches
  863.  
  864. |:range|    +[num]        add [num] to the preceding line number
  865.                    (default: 1)
  866. |:range|    -[num]        subtract [num] from the preceding line
  867.                    number (default: 1)
  868. ------------------------------------------------------------------------------
  869. *X_ex*        Special Ex characters
  870.  
  871. |:bar|        |        separates two commands (not for ":global" and ":!")
  872. |:quote|    "        begins comment
  873.  
  874. |:_%|        %        current filename (only where filename is expected)
  875. |:_#|        #[number]    alternate filename [number] (only where filename is
  876.                expected)
  877.     Note: The next four are typed literally; these are not special keys!
  878. |:<cword>|  <cword>    word under the cursor (only where filename is
  879.                expected)
  880. |:<cWORD>|  <cWORD>    WORD under the cursor (only where filename is
  881.                expected) (see |WORD|)
  882. |:<cfile>|  <cfile>    file name under the cursor (only where filename is
  883.                expected)
  884. |:<afile>|  <afile>    file name for autocommand (only where filename is
  885.                expected)
  886.  
  887.             After "%", "#", "<cfile>", or "<afile>"
  888.             |::p|        :p        full path
  889.             |::h|        :h        head
  890.             |::t|        :t        tail
  891.             |::r|        :r        root
  892.             |::e|        :e        extension
  893. ------------------------------------------------------------------------------
  894. *X_ed*        Editing a file
  895.  
  896. |:edit|       :e[dit]        Edit the current file, unless changes have
  897.                    been made.
  898. |:edit!|   :e[dit]!        Edit the current file always.  Discard any
  899.                    changes.
  900. |:edit_f|  :e[dit] {file}    Edit {file}, unless changes have been made.
  901. |:edit!_f| :e[dit]! {file}    Edit {file} always.  Discard any changes.
  902. |CTRL-^|   N   CTRL-^        Edit alternate file N (equivalent to ":e #N").
  903. |gf|           gf  or ]f    Edit the file whose name is under the cursor
  904. |:pwd|       :pwd            Print the current directory name.
  905. |:cd|       :cd [path]        Change the current directory to [path].
  906. |:file|       :f[ile]        Print the current filename and the cursor
  907.                    position.
  908. |:file|       :f[ile] {name}    Set the current filename to {name}.
  909. |:files|   :files        Show alternate filenames.
  910. ------------------------------------------------------------------------------
  911. *X_fl*        Using the argument list            |argument_list|
  912.  
  913. |:args|       :ar[gs]        Print the argument list, with the current file
  914.                    in "[]".
  915. |:all|       :all  or :sall    Open a window for every file in the arg list.
  916. |:wn|       :wn[ext][!]        Write file and edit next file.
  917. |:wn|       :wn[ext][!] {file}    Write to {file} and edit next file, unless
  918.                    {file} exists.  With !, overwrite existing
  919.                    file.
  920. |:wN|       :wN[ext][!] [file]    Write file and edit previous file.
  921.  
  922.            in current window    in new window
  923. |:argument|  :argu[ment] N      :sar[gument] N    Edit file N
  924. |:next|         :n[ext]          :sn[ext]        Edit next file
  925. |:next_f|    :n[ext] {arglist}      :sn[ext] {arglist}    define new arg list
  926.                                and edit first file
  927. |:Next|         :N[ext]          :sN[ext]        Edit previous file
  928. |:rewind|    :rew[ind][!]      :srew[ind]        Edit first file
  929. |:last|         :last          :slast        Edit last file
  930. ------------------------------------------------------------------------------
  931. *X_wq*        Writing and quitting
  932.  
  933. |:w|      :[range]w[rite][!]        Write to the current file.
  934. |:w_f|      :[range]w[rite] {file}    Write to {file}, unless it already
  935.                        exists.
  936. |:w_f|      :[range]w[rite]! {file}    Write to {file}.  Overwrite an existing
  937.                        file.
  938. |:w_a|      :[range]w[rite][!] >>        Append to the current file.
  939. |:w_a|      :[range]w[rite][!] >> {file}    Append to {file}.
  940. |:w_c|      :[range]w[rite] !{cmd}    Execute {cmd} with [range] lines as
  941.                        standard input.
  942. |:wall|      :wall[!]            write all changed buffers
  943.  
  944. |:q|      :q[uit]        Quit current buffer, unless changes have been
  945.                    made.  Exit Vim when there are no other
  946.                    non-help buffers
  947. |:q|      :q[uit]!        Quit current buffer always, discard any
  948.                    changes.  Exit Vim when there are no other
  949.                    non-help buffers
  950. |:qa|      :qall            Exit Vim, unless changes have been made.
  951. |:qa|      :qall!        Exit Vim always, discard any changes.
  952. |:cq|      :cq            Quit without writing and return error code.
  953.  
  954. |:wq|      :wq[!]        Write the current file and exit.
  955. |:wq|      :wq[!] {file}        Write to {file} and exit.
  956. |:xit|      :x[it][!] [file]    Like ":wq" but write only when changes have
  957.                    been made
  958. |ZZ|         ZZ            Same as ":x".
  959. |:xall|      :xall[!]  or :wqall[!]
  960.                 Write all changed buffers and exit
  961.  
  962. |:stop|      :st[op][!]        Suspend VIM or start new shell. If 'aw' option
  963.                    is set and [!] not given write the buffer.
  964. |CTRL-Z|     CTRL-Z        Same as ":stop!"
  965. ------------------------------------------------------------------------------
  966. *X_st*        Starting VIM
  967.  
  968. |-vim|       vim [options]        start editing with an empty buffer
  969. |-file|       vim [options] {file ..}    start editing one or more files
  970. |-tag|       vim [options] -t {tag}    edit the file associated with {tag}
  971. |-qf|       vim [options] -e [fname]    start editing in QuickFix mode,
  972.                        display the first error
  973.  
  974.     Vim arguments:
  975.  
  976. |-gui|    -g            start GUI (also allows other options)
  977.  
  978. |-+|    +[num]            put the cursor at line [num] (default: last line)
  979. |-+c|    +{command}        execute {command} after loading the file
  980. |-+/|    +/{pat} {file ..}   put the cursor at the first occurrence of {pat}
  981. |-v|    -v            read-only mode (View), implies -n
  982. |-R|    -R            read-only mode, same as -v
  983. |-b|    -b            binary mode
  984. |-l|    -l            lisp mode
  985. |-H|    -H            Hebrew mode ('hkmap' and 'rightleft' are set)
  986. |-r|    -r            give list of swap files
  987. |-r|    -r {file ..}        recover aborted edit session
  988. |-n|    -n            do not create swapfile
  989. |-o|    -o [N]            open N windows (default: one for each file)
  990. |-x|    -x            Amiga: do not restart VIM to open a window (for
  991.                 e.g., mail)
  992. |-s|    -s {scriptin}        first read commands from the file {scriptin}
  993. |-w|    -w {scriptout}        write typed chars to file {scriptout} (append)
  994. |-W|    -W {scriptout}        write typed chars to file {scriptout} (overwrite)
  995. |-T|    -T {terminal}        set terminal name
  996. |-d|    -d {device}        Amiga: open {device} to be used as a console
  997. |-u|    -u {vimrc}        read inits from {vimrc} instead of other inits
  998. |-i|    -i {viminfo}        read info from {viminfo} instead of other files
  999. |--|    --            end of options, other arguments are file names
  1000. ------------------------------------------------------------------------------
  1001. *X_ac*        Automatic Commands
  1002.  
  1003. |viminfo_file|    Read registers, marks, history at startup, save when exiting.
  1004.  
  1005. |:rviminfo|    :rv[iminfo] [file]    Read info from viminfo file [file]
  1006. |:rviminfo|    :rv[iminfo]! [file]    idem, overwrite exisiting info
  1007. |:wviminfo|    :wv[iminfo] [file]    Add info to viminfo file [file]
  1008. |:wviminfo|    :wv[iminfo]! [file]    Write info to viminfo file [file]
  1009.  
  1010. |modeline|    Automatic option setting when editing a file
  1011.  
  1012. |modeline|    vim:{set-arg}: ..    In the first and last lines of the
  1013.                     file (see 'ml' option), {set-arg} is
  1014.                     given as an argument to ":set"
  1015.  
  1016. |autocommand|    Automatic execution of commands on certain events.
  1017.  
  1018. |:autocmd|    :au            List all autocommands
  1019. |:autocmd|    :au {event}        List all autocommands for {event}
  1020. |:autocmd|    :au {event} {pat}    List all autocommands for {event} with
  1021.                     {pat}
  1022. |:autocmd|    :au {event} {pat} {cmd}    Enter new autocommands for {event}
  1023.                     with {pat}
  1024. |:autocmd|    :au!            Remove all autocommands
  1025. |:autocmd|    :au! {event}        Remove all autocommands for {event}
  1026. |:autocmd|    :au! * {pat}        Remove all autocommands for {pat}
  1027. |:autocmd|    :au! {event} {pat}    Remove all autocommands for {event}
  1028.                     with {pat}
  1029. |:autocmd|    :au! {event} {pat} {cmd}  Remove all autocommands for {event}
  1030.                     with {pat} and enter new one
  1031. ------------------------------------------------------------------------------
  1032. *X_wi*        Multi-window functions
  1033.  
  1034. |CTRL-W_s|    CTRL-W s  or  :split    Split window into two parts
  1035. |:split_f|    :split {file}        Split window and edit {file} in one of
  1036.                        them
  1037. |CTRL-W_]|    CTRL-W ]        Split window and jump to tag under
  1038.                        cursor
  1039. |CTRL-W_f|    CTRL-W f        Split window and edit file name under
  1040.                        the cursor
  1041. |CTRL-W_CTRL-^| CTRL-W CTRL-^        Split window and edit alternate file
  1042. |CTRL-W_n|    CTRL-W n  or  :new    Create new empty window
  1043. |CTRL-W_q|    CTRL-W q  or  :q[uit]    Quit editing and close window
  1044. |CTRL-W_c|    CTRL-W c  or  :cl[ose]    Make buffer hidden and close window
  1045. |CTRL-W_o|    CTRL-W o  or  :on[ly]    Make current window only one on the
  1046.                        screen
  1047.  
  1048. |CTRL-W_j|    CTRL-W j        Move cursor to window below
  1049. |CTRL-W_k|    CTRL-W k        Move cursor to window above
  1050. |CTRL-W_CTRL-W|    CTRL-W CTRL-W        Move cursor to window below (wrap)
  1051. |CTRL-W_W|    CTRL-W W        Move cursor to window above (wrap)
  1052. |CTRL-W_t|    CTRL-W t        Move cursor to top window
  1053. |CTRL-W_b|    CTRL-W b        Move cursor to bottom window
  1054. |CTRL-W_p|    CTRL-W p        Move cursor to previous active window
  1055.  
  1056. |CTRL-W_r|    CTRL-W r        Rotate windows downwards
  1057. |CTRL-W_R|    CTRL-W R        Rotate windows upwards
  1058. |CTRL-W_x|    CTRL-W x        Exchange current window with next one
  1059.  
  1060. |CTRL-W_=|    CTRL-W =        Make all windows equal height
  1061. |CTRL-W_-|    CTRL-W -        Decrease current window height
  1062. |CTRL-W_+|    CTRL-W +        Increase current window height
  1063. |CTRL-W__|    CTRL-W _        Set current window height (default:
  1064.                        very high)
  1065. ------------------------------------------------------------------------------
  1066. *X_bu*        Buffer list functions
  1067.  
  1068. |:buffers|    :buffers  or  :files    list all known buffer and file names
  1069.  
  1070. |:ball|        :ball      or  :sball    edit all args/buffers
  1071. |:unhide|    :unhide   or  :sunhide    edit all loaded buffers
  1072.  
  1073. |:bunload|    :bunload[!] [N]        unload buffer [N] from memory
  1074. |:bdelete|    :bdelete[!] [N]        unload buffer [N] and delete it from
  1075.                        the buffer list
  1076.  
  1077.             in current window   in new window
  1078. |:buffer|     :[N]buffer [N]      :[N]sbuffer [N]     to arg/buf N
  1079. |:bnext|      :[N]bnext [N]      :[N]sbnext [N]      to Nth next arg/buf
  1080. |:bNext|      :[N]bNext [N]      :[N]sbNext [N]      to Nth previous arg/buf
  1081. |:bprevious|  :[N]bprevious [N]   :[N]sbprevious [N]  to Nth previous arg/buf
  1082. |:brewind|    :brewind          :sbrewind          to first arg/buf
  1083. |:blast|      :blast          :sblast          to last arg/buf
  1084. |:bmodified|  :[N]bmod [N]      :[N]sbmod [N]          to Nth modified buf
  1085. ------------------------------------------------------------------------------
  1086. *bars*        Bars example
  1087.  
  1088. Now that you've jumped here with CTRL-], g<LeftMouse>, or <C-LeftMouse>, you
  1089. can use CTRL-T, g<RightMouse>, or <C-RightMouse> to go back to where you were.
  1090. ------------------------------------------------------------------------------
  1091.  
  1092. For the most recent information about Vim:        *www* *faq* *FAQ*
  1093.     VIM home page:    <URL:http://www.math.fu-berlin.de/~guckes/vim/>
  1094.     VIM FAQ:    <URL:http://www.grafnetix.com/~laurent/vim/>
  1095.  
  1096. Bug reports:                            *bugs*
  1097.     Bram Moolenaar <mool@oce.nl>
  1098. Please be brief; all the time that is spend on answering mail is subtracted
  1099. from the time that is spent on improving Vim!  Always give a reproducible
  1100. example and try to find out which settings or other things influence the
  1101. appearance of the bug.  Try different machines, if possible.  Send me patches
  1102. if you can!  In case of doubt, include the output of these commands:
  1103.     :version
  1104.     :!uname -a    " Unix only
  1105.     :map
  1106.     :map!
  1107.     :au
  1108.     :set all
  1109.     :set termcap
  1110.  
  1111. Usenet News group where Vim is discussed:        *news* *usenet*
  1112.     comp.editors
  1113.  
  1114.                             *vimdev* *mail_list*
  1115. There are three mailing lists for Vim:
  1116. <vim@prz.tu-berlin.de>        For discussions about using existing versions
  1117.                 of Vim: Useful mappings, questions, answers,
  1118.                 where to get a specific version, etc.
  1119. <vimdev@prz.tu-berlin.de>    For discussions about changing Vim: New
  1120.                 features, porting, etc.
  1121. <vimannounce@prz.tu-berlin.de>    Announcements about new versions of Vim; also
  1122.                 beta-test versions and ports to different
  1123.                 systems.
  1124.  
  1125. NOTE: You can only send messages to these lists if you have subscribed!  Also:
  1126. you need to send the messages from the same location as the one you subscribed
  1127. from (yes, Majordomo is not flexible).
  1128.  
  1129. If you want to join, send a message to
  1130.     <majordomo@prz.tu-berlin.de>
  1131. and put "info" in the body.  Then Majordomo will give you a little help.
  1132.  
  1133. An archive is kept at:
  1134. <URL:ftp://ftp.ii.uib.no/pub/vim/mail-archive/vim/maillist.html>
  1135. <URL:ftp://ftp.ii.uib.no/pub/vim/mail-archive/vimdev/maillist.html>
  1136. <URL:ftp://ftp.ii.uib.no/pub/vim/mail-archive/vimannounce/maillist.html>
  1137.  
  1138. *credits* *author*
  1139.  
  1140. Most of Vim was written by Bram Moolenaar <mool@oce.nl>.
  1141.  
  1142. Parts of the documentation come from several Vi manuals, written by:
  1143.     W.N. Joy
  1144.     Alan P.W. Hewett
  1145.     Mark Horton
  1146.  
  1147. The Vim editor is based on Stevie and includes (ideas from) other software,
  1148. worked on by the people mentioned here.  Other people helped by giving me
  1149. suggestions and discussing what is good and bad in Vim.
  1150.  
  1151.     Tony Andrews        Stevie
  1152.     Gert van Antwerpen    changes for DJGPP on MS-DOS
  1153.     Berkeley DB(3)        ideas for swapfile
  1154.     Keith Bostic        nvi
  1155.     Ralf Brown        SPAWNO library for MS-DOS
  1156.     Robert Colon        many useful remarks
  1157.     Kayhan Demirel        sent me news in Uganda
  1158.     Chris & John Downey    xvi (ideas for multi-windows version)
  1159.     Eric Fischer        Mac port, 'cindent', and other improvements
  1160.     Bill Foster        Athena GUI port
  1161.     Loic Grenie        xvim (ideas for multi windows version)
  1162.     Steve Kirkendall    Elvis
  1163.     Sergey Laskavy        Vim's help from Moscow
  1164.     Avner Lottem        Edit in right-to-left windows (RIGHTLEFT)
  1165.     George V. Reilly    Win32 port
  1166.     Stephen Riehm        bug collector
  1167.     Olaf Seibert        DICE version and regexp improvements
  1168.     Peter da Silva        termlib
  1169.     Paul Slootman        OS/2 port
  1170.     Henry Spencer        regular expressions
  1171.     Tim Thompson        Stevie
  1172.     G. R. (Fred) Walter    Stevie
  1173.     Robert Webb        Command-line completion, GUI version, and lots
  1174.                 of patches
  1175.     Juergen Weigert        Lattice version, AUX improvements, UNIX and
  1176.                 MS-DOS ports, autoconf
  1177.  
  1178. I wish to thank all the people that sent me bug reports and suggestions.  The
  1179. list is too long to mention them all here.  Vim would not be the same without
  1180. the ideas from all these people: they keep Vim alive!
  1181.  
  1182.  vim:ts=8:sw=8:js:tw=78:fo=tcq2:isk=!-~,^*,^\|,^\":
  1183.